import requests
url="https://api.github.com/search/repositories"
url+="?q=language:python+sort:stars+stars:>10000"

headers={"Accept":"application/vnd.github.v3+json"}

r=requests.get(url,headers=headers)

print(f"Status code:{r.status_code}")#核实调用是否成功

responses_dict=r.json()#将响应内容转换为字典。
print(f"total repositories:{responses_dict["total_count"]}")#反映符合条件代码仓库数量。
print(f"Complete results:{not responses_dict['incomplete_results']}")#告知用户有限的时间里面是否完成了所有的查询。
# print(responses_dict.keys())#打印字典里的键
repo_dicts=responses_dict["items"]
print(f"Repositories returned:{len(repo_dicts)}")#默认返回第一页
for repo_dicts in repo_dicts:#研究第一个仓库
# print(f"\nKeys:{len(repo_dicts)}")
# for key in sorted(repo_dicts.keys()):
#     print(key)
    print(f"Name:{repo_dicts["name"]}")
    print(f"Owner:{repo_dicts["owner"]["login"]}")
    print(f"Stars:{repo_dicts["stargazers_count"]}")
    print(f"Repository:{repo_dicts["html_url"]}")
    print(f"Created:{repo_dicts["created_at"]}")
    print(f"Updated{repo_dicts["updated_at"]}")
    print(f"Description{repo_dicts["updated_at"]}")